import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ThreeServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 通过请求对象, 读取{请求体}的参数信息
        // 方法和请求头中一模一样
        // 通知请求对象使用UTF-8字符集解码
        request.setCharacterEncoding("UTF-8");
        String value = request.getParameter("username");
        System.out.println("username = " + value);
    }
}
